package com.xunlai.infra.permission.business.dao.repository;

import com.xunlai.infra.permission.business.dao.entity.PosterFavorite;
import com.xunlai.infra.permission.storage.repository.BaseAllRoundRepository;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author liang
 * @date 8/7/23 9:50 PM
 */
@Transactional(rollbackFor = Exception.class)
public interface PosterFavoriteRepository extends BaseAllRoundRepository<PosterFavorite,Long> {
    @Query("delete from travel_poster_favorite where poster_id = :posterId and user_id = :userId")
    @Modifying
    void deleteByPosterIdAndUserId(@Param("posterId") Long posterId,@Param("userId") Long userId);

}
